Skip to content

Update LP/QP/MILP docs to cover 26.06 API additions#1339

Open
rg20 wants to merge 13 commits into
NVIDIA:release/26.06from
rg20:docs_26.06
Open

Update LP/QP/MILP docs to cover 26.06 API additions#1339
rg20 wants to merge 13 commits into
NVIDIA:release/26.06from
rg20:docs_26.06

Conversation

@rg20
Copy link
Copy Markdown
Contributor

@rg20 rg20 commented May 29, 2026

  • C API: add cuOptWriteProblem, warm start functions (cuOptSetInitialPrimalSolution, cuOptSetInitialDualSolution, cuOptAddMIPStart), MIP callback types and registration functions, file format constants, MIP determinism mode constants, barrier iterative refinement constants, CUOPT_TERMINATION_STATUS_WORK_LIMIT, CUOPT_METHOD_UNSET, and all previously missing parameter constants (work limit, random seed, presolve file, num GPUs, MIP symmetry, MIP determinism mode, cut types, branching settings, etc.)
  • Python API: expose NumVariables, NumConstraints, NumNZs, IsMIP properties
  • Settings: add descriptions for work limit, random seed, presolve file, primal/dual infeasibility tolerances, barrier iterative refinement, barrier step scale, MIP determinism mode, MIP symmetry, flow cover/implied bound/clique cuts, objective step, semi-continuous big-M, batch PDLP reliability branching, strong branching simplex limit

Description

Issue

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

@rg20 rg20 requested a review from a team as a code owner May 29, 2026 14:25
@rg20 rg20 requested a review from Iroy30 May 29, 2026 14:25
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 29, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rg20 rg20 added this to the 26.06 milestone May 29, 2026
@rg20 rg20 added doc Improvements or additions to documentation non-breaking Introduces a non-breaking change labels May 29, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Expanded cuOpt docs: added C problem write API and MPS file format constant; documented many solver parameter and method constants; added warm‑start/MIP‑start and MIP callback docs; extended lp-qp-milp settings; exposed Python Problem members and added SOCP (beta) docs.

Changes

API Documentation Expansion

Layer / File(s) Summary
C API — Problem I/O & SOCP note
docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst
Adds cuOptWriteProblem beside cuOptReadProblem, introduces CUOPT_FILE_FORMAT_MPS, and updates QP/QCQP guidance to describe SOCP conversion for quadratic constraints.
C API — Parameter & Termination Constants
docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst
Adds CUOPT_WORK_LIMIT, determinism/symmetry flags, barrier/PDLP/output/thread/GPU/random/precision controls, extensive MIP cut/branching/reliability parameters, and CUOPT_TERMINATION_STATUS_WORK_LIMIT.
C API — Methods, Warm‑start, Callbacks
docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst
Documents CUOPT_METHOD_UNSET, determinism/mode and barrier iterative refinement constants, warm-start/MIP-start functions (cuOptSetInitialPrimalSolution, cuOptSetInitialDualSolution, cuOptAddMIPStart), and MIP solution callback typedefs/registration functions.
Settings reference (lp-qp-milp)
docs/cuopt/source/lp-qp-milp-settings.rst
Adds batched PDLP reliability branching, strong-branching simplex limits, MIP determinism and symmetry docs, flow-cover/implied-bound/clique cut settings, objective-step tightening, semi-continuous Big‑M, work/seed/presolve controls, PDLP infeasibility tolerances, and barrier tuning options.
Python API & SOCP feature docs
docs/cuopt/source/cuopt-python/lp-qp-milp/*, docs/cuopt/source/lp-qp-features.rst, docs/cuopt/source/cuopt-c/lp-qp-milp/index.rst
Exposes NumNZs, NumVariables, NumConstraints, IsMIP in Python Problem docs; adds __le__/__ge__/__neg__ to QuadraticExpression docs; updates index captions to include SOCP; and adds SOCP (Beta) feature documentation and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Iroy30
  • chris-maes
  • mlubin
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main purpose of the PR: updating documentation for 26.06 API additions to LP/QP/MILP docs.
Description check ✅ Passed The description is directly related to the changeset, providing detailed bullet points covering the C API, Python API, and settings documentation additions that align with the file modifications shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/cuopt/source/lp-qp-milp-settings.rst (1)

570-576: 💤 Low value

Clarify the default value notation for strong branching simplex iteration limit.

The note says "By default there is no iteration limit" but does not explicitly mention that the implementation uses -1 to represent "no limit." For consistency with other parameters (e.g., CUOPT_RANDOM_SEED at line 660), consider stating the actual default value.

♻️ Suggested clarification
-.. note:: By default there is no iteration limit for strong branching solves.
+.. note:: The default value is ``-1`` (no iteration limit).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/cuopt/source/lp-qp-milp-settings.rst` around lines 570 - 576, Update the
documentation for CUOPT_MIP_STRONG_BRANCHING_SIMPLEX_ITERATION_LIMIT to
explicitly state that the implementation uses -1 to denote "no limit" (e.g.,
"Default: -1 (no limit)"), mirroring the notation used for other parameters like
CUOPT_RANDOM_SEED; edit the paragraph and the note text so readers see the
concrete default value and its meaning.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst`:
- Around line 46-49: Update the brief description so it accurately reflects
cuOptWriteProblem's purpose: change the sentence "Optimization problems can be
created or loaded via the following functions" to a phrase that includes writing
(for example, "Optimization problems can be created, loaded, or written via the
following functions") or split into two sentences separating creation/loading
from read/write operations; ensure both cuOptReadProblem and cuOptWriteProblem
are mentioned appropriately (e.g., "...loaded via cuOptReadProblem" and
"...written via cuOptWriteProblem") so the docstring precisely matches each
function's role.

In `@docs/cuopt/source/lp-qp-milp-settings.rst`:
- Around line 629-636: The docs for CUOPT_MIP_OBJECTIVE_STEP are incorrect: the
implementation treats objective_step as a 0/1 toggle (objective_step = 1 by
default) rather than a positive numeric step; update the text to state that
CUOPT_MIP_OBJECTIVE_STEP is a boolean-like flag (0 = disable, 1 = enable),
change the default in the note to 1 (enabled), and remove or reword any mention
of providing a positive step size to override detection so the wording matches
the implementation referenced in solver_settings.cu and solver_settings.hpp and
the objective_step field.

---

Nitpick comments:
In `@docs/cuopt/source/lp-qp-milp-settings.rst`:
- Around line 570-576: Update the documentation for
CUOPT_MIP_STRONG_BRANCHING_SIMPLEX_ITERATION_LIMIT to explicitly state that the
implementation uses -1 to denote "no limit" (e.g., "Default: -1 (no limit)"),
mirroring the notation used for other parameters like CUOPT_RANDOM_SEED; edit
the paragraph and the note text so readers see the concrete default value and
its meaning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4afe87cf-5eb8-4fda-8c04-6f8f5a8aec6c

📥 Commits

Reviewing files that changed from the base of the PR and between 0622d71 and 2e78201.

📒 Files selected for processing (3)
  • docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst
  • docs/cuopt/source/cuopt-python/lp-qp-milp/lp-qp-milp-api.rst
  • docs/cuopt/source/lp-qp-milp-settings.rst

Comment thread docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst Outdated
Comment thread docs/cuopt/source/lp-qp-milp-settings.rst Outdated
rg20 and others added 5 commits May 29, 2026 12:58
- C API: add cuOptWriteProblem, warm start functions (cuOptSetInitialPrimalSolution,
  cuOptSetInitialDualSolution, cuOptAddMIPStart), MIP callback types and registration
  functions, file format constants, MIP determinism mode constants, barrier iterative
  refinement constants, CUOPT_TERMINATION_STATUS_WORK_LIMIT, CUOPT_METHOD_UNSET, and
  all previously missing parameter constants (work limit, random seed, presolve file,
  num GPUs, MIP symmetry, MIP determinism mode, cut types, branching settings, etc.)
- Python API: expose NumVariables, NumConstraints, NumNZs, IsMIP properties
- Settings: add descriptions for work limit, random seed, presolve file,
  primal/dual infeasibility tolerances, barrier iterative refinement, barrier step scale,
  MIP determinism mode, MIP symmetry, flow cover/implied bound/clique cuts, objective step,
  semi-continuous big-M, batch PDLP reliability branching, strong branching simplex limit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- lp-qp-features.rst: add Second-Order Cone Programming beta section
  explaining SOCP support via quadratic constraints, auto barrier
  selection, constraints/limitations, and Python/C usage examples
- lp-qp-milp-c-api.rst: add beta note to cuOptAddQuadraticConstraint
  section explaining SOCP auto-detection and sense restrictions
- lp-qp-milp-api.rst: expose QuadraticExpression __le__, __ge__,
  __neg__ operators via special-members for SOCP constraint authoring
- Update index titles in C and Python sections to include SOCP

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rg20
Copy link
Copy Markdown
Contributor Author

rg20 commented May 29, 2026

/ok to test e99f396

Copy link
Copy Markdown
Collaborator

@rgsl888prabhu rgsl888prabhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add few examples on SOCP to different APIs.

rg20 and others added 6 commits May 29, 2026 16:20
Restructure the combined LP/QP/MILP documentation into two distinct sections:
- Continuous Optimization (LP, QP, SOCP/QCQP) with dedicated settings, C API,
  Python API, and examples pages
- MIP with its own settings, C API, Python API, and examples pages

Files are kept flat within existing lp-qp-milp/ directories. Old combined files
remain on disk for reference but are removed from toctrees.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix RST title underline length warning in cuopt-python/lp-qp-milp/index.rst.
Remove old combined LP/QP/MILP files that have been replaced by the split
continuous/MIP documentation:
- lp-qp-milp-settings.rst → continuous-settings.rst + mip-settings.rst
- lp-qp-features.rst → continuous-features.rst
- lp-qp-milp-c-api.rst → continuous-c-api.rst + mip-c-api.rst
- lp-qp-example.rst → continuous-examples.rst
- milp-examples.rst → mip-examples.rst
- lp-qp-milp-api.rst → continuous-api.rst
- lp-qp-milp-examples.rst → continuous-examples.rst + mip-examples.rst

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split lp-qp-milp/ into separate domain directories:
- cuopt-c/continuous/ — LP/QP/SOCP C API, settings, and examples
- cuopt-c/mip/        — MIP C API, settings, and examples
- cuopt-python/continuous/ — LP/QP/SOCP Python API and examples
- cuopt-python/mip/        — MIP Python API and examples

Parallel structure with cuopt-python/routing/ for consistency.
Update all cross-references in settings, grpc, and parent index files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cuOpt reads quadratic constraints in QCQP format and converts to
second-order cone form internally. Update the problem formulation,
example comments, and C API note to reflect the actual user-facing API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…neral QCQP

cuOpt supports SOCP, not general QCQP. SOC constraints are specified
via the quadratic constraint API (||u||_2 <= t written as u^T*u - t^2 <= 0),
and cuOpt detects SOC structure internally. Make this distinction explicit
and add a note that arbitrary quadratic constraints are not supported.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

.. note::
``cuOptAddQuadraticConstraint`` enables **SOCP (beta)** support. SOC constraints are specified
as quadratic inequalities (e.g. ``u^T*u - t^2 <= 0`` for ``||u||_2 <= t``); cuOpt detects the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rotated SOC format (u^T*u <= t * y, y >= 0, t >= 0) should be documented if supported.


.. code-block:: text

Optimal solution found in 0.00 seconds
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a way to test that the script produces exactly this output?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. @rgsl888prabhu I remember you had a way to test these.


.. note::
The QP solver is not currently supported in third-party modeling languages.
The QP and SOCP solvers are not currently supported in third-party modeling languages.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QP is supported via JuMP, and I think this text may not age well since other interfaces will likely add support for socp quickly.

||u_i||_2 <= t_i (second-order cone constraints)
lb <= x <= ub

Because cuOpt does not accept cone constraints directly, SOC constraints are specified through the quadratic constraint API. Each SOC constraint ``||u||_2 <= t`` is expressed as the equivalent quadratic inequality ``u^T*u - t^2 <= 0``. cuOpt detects the SOC structure and converts to cone form internally before solving with the barrier method.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention rotated SOC if supported.

rg20 and others added 2 commits May 29, 2026 19:40
Add CVXPY (LP + QP), update JuMP to include QP support.
Clarify AMPL and GAMS are LP-only. Use a table for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants